// pages/foodEnergyDetail/foodEnergyDetail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    leftIndex: 0,
    leftData: [
      "薯类淀粉制品",
      "蔬菜类",
      "肉类",
      "菌菇类",
      "奶类",
      "加工肉制品",
      "豆类及制品",
      "蛋类",
      "水果类",
      "糖类",
      "谷物及制品",
      "其他类",
    ],
    rightData: [
      //薯类淀粉及制品
      [
        {
          name: "南瓜",
          value: "22"
        },
        {
          name: "小米粥",
          value: "46"
        },
        {
          name: "米粥（粳米）",
          value: "46"
        },
        {
          name: "山药",
          value: "56"
        },
        {
          name: "莲藕",
          value: "70"
        },
        {
          name: "土豆",
          value: "76"
        },
        {
          name: "芋头",
          value: "79"
        },
        {
          name: "红薯",
          value: "99"
        },
        {
          name: "甘薯（白心）",
          value: "104"
        },
        {
          name: "鲜玉米",
          value: "106"
        },
        {
          name: "煮面条",
          value: "109"
        },
        {
          name: "肠粉",
          value: "110"
        },
        {
          name: "米饭（粳米）",
          value: "117"
        },
        {
          name: "河粉",
          value: "129"
        },
        {
          name: "糯玉米",
          value: "172"
        },
        {
          name: "荞麦馒头",
          value: "218"
        },
        {
          name: "白馒头",
          value: "223"
        },
        {
          name: "饺子",
          value: "250"
        },
      ],
      //蔬菜类
      [
        {
          name: "冬瓜",
          value: "11"
        },
        {
          name: "娃娃菜",
          value: "13"
        },
        {
          name: "生菜",
          value: "13"
        },
        {
          name: "芥菜",
          value: "14"
        },
        {
          name: "油麦菜",
          value: "15"
        },
        {
          name: "小白菜",
          value: "15"
        },
        {
          name: "黄瓜",
          value: "15"
        },
        {
          name: "西芹",
          value: "17"
        },
        {
          name: "莴笋叶",
          value: "18"
        },
        {
          name: "绿豆芽",
          value: "18"
        },
        {
          name: "番茄",
          value: "19"
        },
        {
          name: "空心菜",
          value: "20"
        },
        {
          name: "丝瓜",
          value: "20"
        },
        {
          name: "菜心",
          value: "20"
        },
        {
          name: "大白菜",
          value: "21"
        },
        {
          name: "甘蓝（卷心菜）",
          value: "22"
        },
        {
          name: "花菜",
          value: "24"
        },
        {
          name: "菠菜",
          value: "24"
        },
        {
          name: "番薯叶",
          value: "27"
        },
        {
          name: "四季豆",
          value: "28"
        },
        {
          name: "豆角",
          value: "30"
        },
        {
          name: "西兰花",
          value: "33"
        },
        {
          name: "蒜台",
          value: "37"
        },
        {
          name: "洋葱",
          value: "39"
        },
        {
          name: "黄豆芽",
          value: "44"
        },
      ],
      //肉类
      [
        {
          name: "花甲",
          value: "45"
        },
        {
          name: "猪血",
          value: "55"
        },
        {
          name: "鸭血（白鸭）",
          value: "58"
        },
        {
          name: "罗非鱼",
          value: "77"
        },
        {
          name: "虾",
          value: "84"
        },
        {
          name: "石斑鱼",
          value: "85"
        },
        {
          name: "小龙虾",
          value: "90"
        },
        {
          name: "鸭胗",
          value: "92"
        },
        {
          name: "大黄花鱼",
          value: "96"
        },
        {
          name: "小黄花鱼",
          value: "99"
        },
        {
          name: "胖头鱼",
          value: "100"
        },
        {
          name: "鲈鱼",
          value: "100"
        },
        {
          name: "螃蟹",
          value: "103"
        },
        {
          name: "瘦牛肉",
          value: "106"
        },
        {
          name: "鲤鱼",
          value: "109"
        },
        {
          name: "猪肚",
          value: "110"
        },
        {
          name: "草鱼",
          value: "112"
        },
        {
          name: "瘦羊肉",
          value: "118"
        },
        {
          name: "鸡胗",
          value: "118"
        },
        {
          name: "牛腩",
          value: "123"
        },
        {
          name: "猪肝",
          value: "129"
        },
        {
          name: "鸭肠",
          value: "129"
        },
        {
          name: "鸡胸肉",
          value: "133"
        },
        {
          name: "猪瘦肉",
          value: "143"
        },
        {
          name: "鸭爪",
          value: "150"
        },
        {
          name: "虾皮",
          value: "153"
        },
        {
          name: "鸡腿",
          value: "181"
        },
        {
          name: "肥牛",
          value: "190"
        },
        {
          name: "鸡翅",
          value: "194"
        },
        {
          name: "肥羊",
          value: "198"
        },
        {
          name: "鸭",
          value: "240"
        },
        {
          name: "鸭脖",
          value: "240"
        },
        {
          name: "鸡爪",
          value: "254"
        },
        {
          name: "排骨",
          value: "278"
        }
      ],
      //菌菇类
      [
        {
          name: "香菇（鲜）",
          value: "19"
        },
        {
          name: "平菇",
          value: "20"
        },
        {
          name: "金针菇",
          value: "26"
        },
        {
          name: "杏鲍菇",
          value: "35"
        },
        {
          name: "香菇（干）",
          value: "211"
        },
        {
          name: "茶树菇",
          value: "309"
        },


      ],
      //奶类
      [
        {
          name: "脱脂牛奶",
          value: "33"
        },
        {
          name: "低脂牛奶",
          value: "43"
        },
        {
          name: "纯牛奶",
          value: "54"
        },
        {
          name: "无糖酸奶",
          value: "60"
        },
        {
          name: "早餐奶",
          value: "68"
        },
        {
          name: "酸奶",
          value: "72"
        },
        {
          name: "双皮奶",
          value: "79"
        },
        {
          name: "安慕希酸奶",
          value: "99"
        },
        {
          name: "奶酪",
          value: "328"
        },
        {
          name: "奶片",
          value: "472"
        },

      ],
      //加工肉制品
      [
        { name: "鱼丸", value: "107" },
        { name: "牛肉丸", value: "141" },
        { name: "火腿", value: "211" },
        { name: "烤肠", value: "298" },
        { name: "牛肉干", value: "550" },
        { name: "腊肠", value: "584" },
      ],
      //豆类及制品
      [
        {name:"豆腐脑",value:"10"},
        {name:"豆浆",value:"13"},
        {name:"油豆腐",value:"244"},
        {name:"白芸豆",value:"296"},
        {name:"杂豆",value:"316"},
        {name:"绿豆",value:"316"},
        {name:"黄豆",value:"359"},
        {name:"黑豆",value:"381"},
        {name:"豆腐皮",value:"409"},
        {name:"黄豆粉",value:"418"},
        {name:"腐竹",value:"459"},
      ],
      //蛋类
      [
        {name:"鸡蛋白",value:"60"},
        {name:"鸡蛋（白皮）",value:"138"},
        {name:"鹌鹑蛋",value:"160"},
        {name:"炒鸡蛋",value:"162"},
        {name:"鸭蛋",value:"180"},
        {name:"咸鸭蛋",value:"190"},
        {name:"煎鸡蛋",value:"195"},
        {name:"鹅蛋",value:"196"},
      ],
      //油脂类
     //水果类
     [
      {name:"黄瓜",value:"16"},
      {name:"番茄",value:"18"},
      {name:"西瓜",value:"20"},
      {name:"柠檬",value:"31"},
      {name:"香瓜",value:"35"},
      {name:"草莓 ",value:"35"},
      {name:"杏子",value:"40"},
      {name:"桃",value:"37"},
      {name:"梨",value:"38"},
      {name:"橙子",value:"48"},
      {name:"苹果",value:"53"},
      {name:"葡萄",value:"54"},
      {name:"猕猴桃",value:"54"},
      {name:"荔枝",value:"57"},
      {name:"香蕉",value:"84"},
      {name:"芒果",value:"100"},
      
    ],
      //糖类
      [
        {name:"蜂蜜",value:"321"},
        {name:"红糖",value:"389"},
        {name:"白糖",value:"396"},
        {name:"冰糖",value:"397"},
        {name:"奶糖",value:"407"},
        {name:"酥糖",value:"436"},
        {name:"巧克力",value:"586"},

      ],
      //谷物及其制品
      [
        {name:"小米粥",value:"46"},
        {name:"面条（煮，富强粉）",value:"109"},
        {name:"米饭（蒸，粳米）",value:"117"},
        {name:"馒头(蒸，标准粉）",value:"233"},
        {name:"荞麦粉",value:"304"},
        {name:"大麦",value:"307"},
        {name:"煎饼",value:"333"},
        {name:"黑米",value:"333"},
        {name:"玉米面",value:"340"},
        {name:"大米",value:"346"},
        {name:"米粉",value:"346"},
        {name:"挂面（富强粉）",value:"347"},
        {name:"通心粉",value:"350"},
        {name:"薏米",value:"357"},
        {name:"小米",value:"358"},
        {name:"燕麦片",value:"367"},
        {name:"油条",value:"386"},
        {name:"油饼",value:"399"},
      ],
      //其他类
      [ 
        {name:"凉粉",value:"37"},
        {name:"年糕",value:"154"},
        {name:"汤包",value:"238"},
        {name:"三鲜豆皮",value:"240"},
        {name:"面包（黄油）",value:"329"},
        {name:"蛋糕",value:"347"},
        {name:"绿豆糕",value:"349"},
        {name:"藕粉",value:"372"},
        {name:"蛋黄酥",value:"386"},
        {name:"饼干（奶油果馅）",value:"429"},
        {name:"月饼",value:"441"},
        {name:"凤尾酥",value:"511"},
        {name:"麻花",value:"524"},
      ]
    ],
    scrollTop:0,
    searchVal:""
  },
  toggleLeftIndex(e) {
    let leftIndex = e.currentTarget.dataset.index;
    this.setData({
      leftIndex,
      scrollTop:0
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // console.log(options);
    this.setData({
      leftIndex:options.leftIndex,
      searchVal:options.searchVal
    })  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})